#!/usr/bin/env python
#coding:utf-8

from sgmllib import SGMLParser
import urllib

class IMGLister(SGMLParser):
    def reset(self):
        SGMLParser.reset(self)
        self.urls = []

    def start_img(self, attrs):
        src = [v for k, v in attrs if k == 'src']
        if src:
            self.urls.extend(src)
